﻿using System;

namespace Entities
{
    [Serializable]
    public class Route
    {
        private int routeID;
        private string routeName;
        public Route()
        { }
        public Route(int routeID, string routeName)
        {
            this.routeID = routeID;
            this.routeName = routeName;
        }
        public int RouteID
        {
            get { return this.routeID; }
            set
            {
                if (value < 0)
                    throw new Exception("routeID not allow nullvalue.");
                this.routeID = value;
            }
        }
        public string RouteName
        {
            get { return this.routeName; }
            set { this.routeName = value; }
        }
        public override string ToString()
        {
            return this.routeID + "; " + this.routeName + "; ";
        }
        public override bool Equals(Object obj)
        {
            Route me = (Route)obj;
            bool ret = this.RouteID.Equals(me.RouteID);
            return ret;
        }
        public override int GetHashCode()
        {
            return this.RouteID.GetHashCode();
        }

    }
}